<%@ page import="service.serviceimpl.ServiceUserImpl" %>
<%@ page import="entity.Userinfo" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        table{
            display: block;
            width: 400px;
            margin: auto;
        }p{
             width: 100px;
             margin: auto;
         }p{
            color: red;
                           }
    </style>
</head>
<body>
<%--<c:if test="${status.index%2==0}">style="background-color: red" </c:if>--%>
<table border="4">
    <tr><th>人员列表</th></tr>
    <tr>
        <th>id</th>
        <th>name</th>
        <th>sex</th>
        <th>age</th>
        <th>ranking</th>
        <th>dept</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${list}" var="xjj" varStatus="status">
        <tr>
            <td>${xjj.id}</td>
            <td>${xjj.name}</td>
            <td>${xjj.sex==1?"男":"女"}</td>
            <td>${xjj.age}</td>
            <td>${xjj.ranking}</td>
            <td>${xjj.dept}</td>
            <td>
                <a href="${pageContext.request.contextPath}/T163Servlet?op=delete&id=${xjj.id}"> <input class="delete" type="button" value="删除"></a>
                <a href="controller.jsp?op=update1&id=${xjj.id}">修改</a>
            </td>
        </tr>
    </c:forEach>
</table>
<p> <a href="add.jsp"> <input  type="button" value=增加></a>
</p>


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
    // $("table").css("background-color","yellow");
    // $("tr:odd").css("background-color","green");
    $(".delete").click(function () {
        if(confirm("删除吗？")){

        }else{
            return false;//把按钮卡死
        }
    });
</script>
</body>
</html>
